

#include"dev_MLX90640_I2C_Driver.h"




IICdevice mlx90640_iic;


void MLX90640_I2CInit(void)
{
	Soft_IIC_Init(&mlx90640_iic);
}

/// <summary>
/// MLX90640_ 的读数据函数
/// </summary>
/// <param name="slaveAddr">设备地址</param>
/// <param name="startAddress">16位的寄存器地址</param>
/// <param name="nMemAddressRead">数据缓存data数组的长度</param>
/// <param name="data">读取数据缓存</param>
/// <returns></returns>
int  MLX90640_I2CRead(unt8 slaveAddr, unt16 startAddress, unt16 nMemAddressRead, unt16* data)
{
	 Soft_IIC_read(&mlx90640_iic, slaveAddr, startAddress, 2, (unt8*)data, nMemAddressRead * 2);
	return 1;
	 
}


/// <summary>
/// 
/// </summary>
/// <param name="slaveAddr">设备地址</param>
/// <param name="writeAddress">16位的寄存器地址</param>
/// <param name="data">写入的数据</param>
/// <returns></returns>
int  MLX90640_I2CWrite(unt8 slaveAddr, unt16 writeAddress, unt16 data)
{
    Soft_IIC_write(&mlx90640_iic, slaveAddr, writeAddress, 2, (unt8*)data, 2);
	// 后面可以再读取数据确认一下
	
	/*
	unt16 datacheck = 0;
	Soft_IIC_read(&mlx90640_iic, slaveAddr, writeAddress, 2, (unt8*)datacheck, 2);
	
	*/
	return 1;
}





